// ThreadTip.cpp: implementation of the CThreadTip class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Rock.h"
#include "ThreadTip.h"
#include "Win32Tool.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

#include "SystemSet.h"


//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CThreadTip::CThreadTip()
{
	m_bShowBorder  = true;
	m_crViewBorder = SS.crThreadTipBorder;
    m_crViewBkg    = SS.crThreadTipBk;
	m_crText  = RGB(0,0,0);
}

CThreadTip::~CThreadTip()
{
}

void CThreadTip::SetSendBnt(){
	if(m_ChildList.size()==1 && m_ChildList.back()->m_Text == "Send")return;
	DeleteAllBnt();
	AddBnt(CMD_SEND,"Send");
};
void CThreadTip::SetRunBnt(){
	if(m_ChildList.size()==3 &&
		m_ChildList[0]->m_Text == "Pause" &&
		m_ChildList[1]->m_Text == "Debug" &&
		m_ChildList[2]->m_Text == "Stop")return;
	DeleteAllBnt();
	AddBnt(CMD_PAUSE,"Pause");
	AddBnt(CMD_DEBUG,"Debug");
	AddBnt(CMD_STOP,"Stop");
};

void CThreadTip::SetContinueRun(){
	if(m_ChildList.size()==3 &&
		m_ChildList[0]->m_Text == "Run" &&
		m_ChildList[1]->m_Text == "Debug" &&
		m_ChildList[2]->m_Text == "Stop")return;
	DeleteAllBnt();
	AddBnt(CMD_RUN,"Run");
	AddBnt(CMD_DEBUG,"Debug");
	AddBnt(CMD_STOP,"Stop");
}

void CThreadTip::SetDebugBnt(){
	if(m_ChildList.size()==3 &&
		m_ChildList[0]->m_Text == "Run" &&
		m_ChildList[1]->m_Text == "Pause" &&
		m_ChildList[2]->m_Text == "Stop")return;
	DeleteAllBnt();
	AddBnt(CMD_RUN,"Run");
	AddBnt(CMD_PAUSE,"Pause");
	AddBnt(CMD_STOP,"Stop");
}

void CThreadTip::SetStopBnt(){
	if(m_ChildList.size()==1 && m_ChildList.back()->m_Text == "Stop")return;
	DeleteAllBnt();
	AddBnt(CMD_STOP,"Stop");
}
